<?php

/*********************************************************************************/
/* CNB Your Account: An Advanced User Management System for phpnuke     		*/
/* ============================================                         		*/
/*                                                                      		*/
/* Copyright (c) 2004 by Comunidade PHP Nuke Brasil                     		*/
/* http://dev.phpnuke.org.br & http://www.phpnuke.org.br                		*/
/*                                                                      		*/
/* Contact author: escudero@phpnuke.org.br                              		*/
/* International Support Forum: http://ravenphpscripts.com/forum76.html 		*/
/*                                                                      		*/
/* This program is free software. You can redistribute it and/or modify 		*/
/* it under the terms of the GNU General Public License as published by 		*/
/* the Free Software Foundation; either version 2 of the License.       		*/
/*                                                                      		*/
/*********************************************************************************/
/* CNB Your Account it the official successor of NSN Your Account by Bob Marion	*/
/*********************************************************************************/

if (!defined('YA_ADMIN')) { echo "CNBYA admin protection"; exit; }
if (!eregi("modules.php", $_SERVER['SCRIPT_NAME'])) {
    header("Location: ../../../index.php");
    die ();
}
if (!defined('CNBYA')) { echo "CNBYA protection"; exit; }
if (($radminsuper==1) OR ($radminuser==1)) {

    $tmp_nick = explode("\r\n",$xbad_nick);
    rsort($tmp_nick);
    for ($i=count($tmp_nick)-1; $i > -1; $i--) {
        if ($tmp_nick[$i] == "") { array_pop($tmp_nick); }
    }
    sort($tmp_nick);
    $xbad_nick = implode("\r\n",$tmp_nick);
	
    $tmp_mail = explode("\r\n",$xbad_mail);
    rsort($tmp_mail);
    for ($i=count($tmp_mail)-1; $i > -1; $i--) {
        if ($tmp_mail[$i] == "") { array_pop($tmp_mail); }
    }
    sort($tmp_mail);
    $xbad_mail = implode("\r\n",$tmp_mail);

    $tmp_domaine = explode("\r\n",$xbon_mail);
    rsort($tmp_domaine);
    for ($i=count($tmp_domaine)-1; $i > -1; $i--) {
        if ($tmp_domaine[$i] == "") { array_pop($tmp_domaine); }
    }
    sort($tmp_domaine);
    $xbon_mail = implode("\r\n",$tmp_domaine);
	
    ya_save_config('sendaddmail', $xsendaddmail, 'nohtml');
    ya_save_config('allowuserdelete', $xallowuserdelete);
    ya_save_config('doublecheckemail', $xdoublecheckemail);
    ya_save_config('coppa', $xcoppa);
    ya_save_config('tos', $xtos);
    ya_save_config('tosall', $xtosall);
    ya_save_config('senddeletemail', $xsenddeletemail);
    ya_save_config('allowusertheme', $xallowusertheme);
    ya_save_config('allowuserreg', $xallowuserreg);
    ya_save_config('allowmailchange', $xallowmailchange);
    ya_save_config('emailvalidate', $xemailvalidate);
	ya_save_config('affichebonmel', $xaffichebonmel);
	ya_save_config('affichemauvaismel', $xaffichemauvaismel);
    ya_save_config('requireadmin', $xrequireadmin);
    ya_save_config('servermail', $xservermail);
    ya_save_config('useactivate', $xuseactivate);
    ya_save_config('usegfxcheck', $xusegfxcheck);
    ya_save_config('autosuspend', $xautosuspend);
    ya_save_config('perpage', $xperpage);
    ya_save_config('expiring', $xexpiring);
    ya_save_config('bad_nick', $xbad_nick, 'nohtml');
    ya_save_config('bad_mail', $xbad_mail, 'nohtml');
	ya_save_config('bon_mel', $xbon_mail, 'nohtml');
    ya_save_config('nick_min', $xnick_min);
    ya_save_config('nick_max', $xnick_max);
    ya_save_config('pass_min', $xpass_min);
    ya_save_config('pass_max', $xpass_max);
    ya_save_config('codesize', $xcodesize);
	ya_save_config('telcontrol', $xtelcontrol);
	ya_save_config('citycontrol', $xcitycontrol);
	ya_save_config('ulkecontrol', $xulkecontrol);
	ya_save_config('meslekcontrol', $xmeslekcontrol);
    ya_save_config('autosuspendmain', $xautosuspendmain);

//    echo "<META HTTP-EQUIV=\"refresh\" content=\"2;URL=modules.php?name=$module_name&file=admin&op=UsersConfig\">";

    $pagetitle = ": "._USERADMIN." - "._YA_USERS;
    include("header.php");
    title(_USERADMIN.": "._YA_USERS);
    amain();
    echo "<br>\n";
    OpenTable();
    echo "<center><h4>"._YACONFIGSAVED."</h4></center>";
    echo "<table align=\"center\"><tr><td><form><input type=\"button\" value=\""._USERSCONFIG."\" onclick=\"javascript:location='modules.php?name=".$module_name."&file=admin&op=UsersConfig';\"></form></td></tr></table>";
    CloseTable();
    include("footer.php");

}

?>